<template>
    <div>

        <el-form :model="model" ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-row>
                <el-col :span="8">
                    <el-form-item label="工作站编码" prop="WorkstationCode">
                        <el-input v-model="model.WorkstationCode" placeholder="工作站编码" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="工作站名称" prop="WorkstationName">
                        <el-input v-model="model.WorkstationName" placeholder="工作站名称" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="工作站地点" prop="WorkstationAddress">
                        <el-input v-model="model.WorkstationAddress" placeholder="工作站地点" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            


            <el-row>
                <el-col :span="8">
                    <el-form-item label="所在车间" prop="WorkshopName">
                        <el-input v-model="model.WorkshopName" placeholder="所在车间" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="所属工序" prop="ProcessName">
                        <el-input v-model="model.ProcessName" placeholder="所属工序" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                <el-form-item label="是否启用" prop="EnableFlag">
                    <el-radio-group v-model="model.EnableFlag" :readonly="true">
                        <el-radio label="Y">是</el-radio>
                        <el-radio label="N">否</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-col>
            </el-row>

            <el-row>
                <el-col :span="8">
                    <el-form-item label="备注" prop="Remark">
                        <el-input v-model="model.Remark" placeholder="备注" :readonly="true"></el-input>
                    </el-form-item>
                </el-col>
                
            </el-row>

            
        </el-form>


        <div style="border: 1px solid #dcdfe6; padding: 10px;">
            <h1 style="margin: 10px;">设备资源</h1>
          
            <el-table :data="tableData" ref="dataForm" v-loading="isLoading" height="360">
                
                    <el-table-column type="selection" width="55"></el-table-column>
                    <el-table-column prop="MachineryCode" label="设备编码" :show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="MachineryName" label="设备名称" :show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="CreateTime" label="时间" :show-overflow-tooltip="true"></el-table-column>
                    

            </el-table>
        </div>
    </div>
</template>




<script>

export default {
    props: {
        model: {
            require: true,
            type: Object,

        }
    },
    data() {
        return {
            tableData: [],
            isLoading: false,
        }
    },
    created() {
        this.GetWorkstationbyId(this.model.Id);
    },
    methods: {

        GetWorkstationbyId(Id) {
            this.isLoading = true;
            this.$http.get('/api/Workstation/GetWorkstationbyId', {
                params: {
                    WorkstationId: Id
                }
            })
                .then(res => {
                    this.tableData = res.Data;
                    this.isLoading = false;
                })
        },

    }
}
</script>